<?php
define('ROOTPATH',dirname(__FILE__).'/');
$server_name=$_SERVER['SERVER_NAME'];
define('ROOTURL',"http://$server_name/mandao/");
define('LIB',ROOTPATH.'lib/');
define('PLUGIN',ROOTPATH.'plugin/');
define('VIEW',ROOTPATH.'view/');
define('JS',ROOTURL.'view/js/');
define('IMAGE',ROOTURL.'view/image/');
define('CSS',ROOTURL.'view/css/');
define('CONSTANT',ROOTPATH.'constant/');
require_once(LIB."mysql.class.php");
require_once(LIB."uid.class.php");
require_once(PLUGIN.'smarty3/Smarty.class.php');
$tpl=new Smarty();
$tpl->template_dir = VIEW.'tpl/';
$tpl->compile_dir  = PLUGIN.'smarty3/templates_c/';
$tpl->config_dir   = PLUGIN.'smarty3/configs/';
$tpl->cache_dir    = PLUGIN.'smarty3/cache/';

$tpl->force_compile = true;
$tpl->debugging = false;
$tpl->caching = false;
$tpl->cache_lifetime = 120;

require_once(CONSTANT."page.php");
/*
$tpl->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
$tpl->assign("FirstName",array("John","Mary","James","Henry"));
$tpl->assign("LastName",array("Doe","Smith","Johnson","Case"));
$tpl->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
	  array("I", "J", "K", "L"), array("M", "N", "O", "P")));

$tpl->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
	  array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));

$tpl->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
$tpl->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
$tpl->assign("option_selected", "NE");

//$tpl->display('index.tpl');


$uid=new UID();
$data=array('id'=>'','username'=>'72df','password'=>'qwertty','email'=>'cdsc','phone'=>'cdsaca','realname'=>'cdcd','invitecode'=>'cdscd','time'=>'now');
$uid->insert('user',$data);

echo "</br>";

//$dsql->ExecuteNoneQuery("insert into user(id,username,password,email,phone,realname,invitecode) values('','sdf','qwertty','cdsc','cdsaca','cdcd','cdscd')");
/*
$dsql->SetQuery("select * from user");
$dsql->Execute();
while($row = $dsql->GetArray())
    {
	var_dump($row);
	}

*/

?>